package cn.lijiajia3515.cairo.auth.modules.serial;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;

@RestController
@RequestMapping("/api/serial")
public class SerialApi {
	private final SerialService serialService;

	public SerialApi(SerialService serialService) {
		this.serialService = serialService;
	}

	@GetMapping("/{client}/{id}")
	@PermitAll
	public long next(@PathVariable String client, @PathVariable String id) {
		return serialService.next(client, id);
	}
}
